Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Syntax allowing factor variables & looping through `varlist'

    I would like to allow factor variable syntax in an ado program. Using auto data, the syntax for the command would look like:
    Code:
    myado foreign i.rep78
    Within the ado script, I would then like to loop through each variable with a variant of:
    Code:
    program myado
    version 11.0 // version I believe factor variables were introduced
    syntax varlist(min=1 numeric fv)
       foreach v of varlist `varlist' {
          markout ...
    Of course the code above will result in the error factor variables not allowed r(101);

    What is a quick and easy way to expand any factor variables and loop through them (allowing the use of the i. syntax)?

    Thank you
Working...
X